// pages/my-back/my-back.js
const util = require('../../utils/util.js')
const { $Toast } = require('../../dist/base/index');
var api = require('../../config/api.js');
const app = getApp();

Page({

  /**
   * 页面的初始数据
   */
  data: {
    id:null,
    seatName:"",
  },
  onShow: function () {
    let self = this;
    util.request(api.MyGetBack, {
    }, 'POST').then(res => {
      debugger
      if (res.success && res.data != null) {
        self.setData({
          id: res.data.id,
          seatName: res.data.seatName
        })
      }
    }).catch(err => {

    });
  },

  clickBack(){
    util.request(`${api.SubmitBack}?id=${this.data.id}`, {
    }, 'POST').then(res => {
      debugger
      if (res.success) {
        wx.navigateBack();
      }
    }).catch(err => {

    });
  }

})
